package com.runen.infinitemovement.adapter;

import android.content.Context;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.runen.infinitemovement.R;
import com.runen.infinitemovement.tool.CommonUtil;

/**
 * Create by LiaoDuanHong
 * Create on
 */
public class MyteamTypeNameAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
    private Context context;
    private int position = 0;

    public MyteamTypeNameAdapter(Context context) {
        super(R.layout.item_my_medal_type_name);
        this.context = context;
    }

    public void setCheckPosition(int position) {
        this.position = position;
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, String item) {
        LinearLayout ll_sports_type = helper.getView(R.id.ll_sports_type);
        TextView tv_sports_type = helper.getView(R.id.tv_sports_type);
        LinearLayout ll_line = helper.getView(R.id.ll_line);
        tv_sports_type.setText(item);
        if (helper.getAdapterPosition() == position) {
            tv_sports_type.setTextColor(CommonUtil.getColor(R.color.color_FFF63E5A));
            ll_line.setVisibility(View.VISIBLE);
        } else {
            tv_sports_type.setTextColor(CommonUtil.getColor(R.color.color_333333));
            ll_line.setVisibility(View.INVISIBLE);
        }
    }
}
